package com.atguigu10._enum;

import java.sql.SQLOutput;

/**
 * ClassName: PersonTest
 * Description:
 *
 * @Author liu
 * @Create 2024/11/12 22:29
 * @Version 1.0
 */
public class SeasonTest2 {
    public static void main(String[] args) {

        Season2[] value = Season2.values();
        for (int i = 0; i <value.length ; i++) {
            value[i].show();
        }
    }

}

interface Info1{
    void show();
}

enum Season2 implements Info1{
    //枚举类用逗号分开
    SPRING("春天","春暖花开"){
        //枚举类中定义Info1 show接口
        public void show(){
            System.out.println("spring");
        }

    },
    SUMMER("夏天","夏日炎炎"){
        public void show(){
            System.out.println("summer");
        }

    },
    AUTUMN("秋天","秋高气爽"){
        public void show(){
            System.out.println("antumn");
        }

    },
    WINTER("冬天","白雪皑皑"){
        public void show(){
            System.out.println("winter");
        }

    };

    //用private final 修饰实例变量
    private final String seasonName;
    private final String seasonDesc;

    //构造器
    Season2(String seasonName, String seasonDesc) {
        this.seasonName = seasonName;
        this.seasonDesc = seasonDesc;
    }
    //get方法
    public String getSeasonName() {
        return seasonName;
    }

    public String getSeasonDesc() {
        return seasonDesc;
    }

    @Override
    public void show() {
        System.out.println("kkkkk");
    }
}

